package com.brave.banner.service;

import com.brave.banner.dto.FindBannerByTypeDTO;
import com.brave.banner.entity.MCBannerInfoEntity;
import com.brave.banner.repository.MCBannerInfoRepository;
import com.brave.base.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class BannerQueryService extends BaseService
{
    
    @Autowired
    private MCBannerInfoRepository bannerInfoRepository;


    /**
     * 2019年10月10日 08:55:46
     * 查询对应模块的Banner图
     * @param dto
     * @return
     */
    public String findBannerByType(FindBannerByTypeDTO dto)
    {
        List<MCBannerInfoEntity> bannerList = new ArrayList<>();
        bannerList = bannerInfoRepository.findByModule(dto.getBannerType().toString());
        return success(bannerList);
    }
    
    
    
    
    
    
    
    
    
    
}